package com.samapp.settings;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.samapp.R;

public class SettingsManageActivity extends Activity implements OnClickListener {

	private Button btnBack = null;
	private Button btnChangePassword = null;
	private Button btnVersion = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.settings_manage);
		init();
	}

	private void init() {
		initView();
		initListener();
	}

	private void initView() {
		btnBack = (Button) findViewById(R.id.btn_back);
		btnChangePassword = (Button) findViewById(R.id.btn_change_password);
		btnVersion = (Button) findViewById(R.id.btn_version_information);
	}

	private void initListener() {
		btnBack.setOnClickListener(this);
		btnChangePassword.setOnClickListener(this);
		btnVersion.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_back:
			finish();
			break;
		case R.id.btn_change_password:
			skip(ChangePasswordActivity.class);
			break;
		case R.id.btn_version_information:
			skip(AboutSamappActivity.class);
			break;
		}
	}

	/** 跳转页面 */
	private void skip(Class<?> cls) {
		Intent intent = new Intent(this, cls);
		startActivity(intent);
	}
}
